package com.chima.dao;

import java.util.List;

import org.hibernate.Session;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.chima.domain.Menu;

public class MenuDao extends HibernateDaoSupport {
	public List<Menu> getallMenus(){
		Session session=this.getSession();
		List<Menu> m= session.createQuery(" from Menu").list();
		super.releaseSession(session);
		return m;
	}

	public List<Menu> getallMenusbyid(int id) {
		Session session=this.getSession();
		List<Menu> m =session.createQuery(" from Menu where  parentid=?").setParameter(0, id).list();
		super.releaseSession(session);
		return m;
	}
}
